package com.basic.config;

import cn.hutool.json.JSONUtil;
import com.basic.modules.ykf.service.YkfDictDetailService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import javax.annotation.PostConstruct;
import java.util.HashMap;
import java.util.Map;

@Slf4j
@Component
public class DictConfig {

    public static Map<String, Map<String, String>> DICT_MAPPER = new HashMap<>();

    @Autowired
    private YkfDictDetailService dictDetailService;


    @PostConstruct
    public void init() {
        DICT_MAPPER.putAll(dictDetailService.getDictMap());
        log.info(JSONUtil.toJsonStr(DICT_MAPPER));
    }
}
